//
//  XGAccountViewModel.h
//  Instagram
//
//  Created by monkey on 2019/4/13.
//  Copyright © 2019 itcast. All rights reserved.
//

#import <AVOSCloud/AVOSCloud.h>

typedef NS_ENUM(NSUInteger, XGGenderType) {
    XGGenderTypeMale = 0, // 男性
    XGGenderTypeFemale = 1, // 女性
};

NS_ASSUME_NONNULL_BEGIN

@interface XGAccountViewModel : AVUser<AVSubclassing>

/// 昵称
@property (nonatomic,strong) NSString *screenName;
/// 性别
@property (nonatomic,assign) XGGenderType gender;
/// 描述信息
@property (nonatomic,copy) NSString *descriptionInfo;
/// 头像
@property (nonatomic,strong) AVFile *userIcon;

/**
 注册用户

 @param email 邮箱
 @param password 密码
 @param screenName 昵称
 @param gender 性别
 @param descriptionInfo 个人描述
 @param userIcon 头像
 @param completion 完成回调
 */
+ (void)registerAccountWithEmail:(NSString *)email password:(NSString *)password screenName:(NSString *)screenName gender:(XGGenderType)gender descriptionInfo:(NSString *)descriptionInfo userIcon:(UIImage *)userIcon completion:(void (^)(BOOL isSuccess,NSString *message))completion;

/**
 登录

 @param email 邮箱
 @param password 密码
 @param completion 完成回调
 */
+ (void)loginWithEmail:(NSString *)email password:(NSString *)password completion:(void (^)(BOOL isSuccess,NSString *message))completion;


/**
 重置密码

 @param email 邮箱
 @param completion 完成回调
 */
+ (void)resetPasswordWithEmail:(NSString *)email completion:(void (^)(BOOL isSuccess,NSString *message))completion;

/**
 更新密码

 @param originalPassword 原始密码
 @param newPassword 新密码
 @param completion 完成回调
 */
- (void)updatePasswordWithOriginal:(NSString *)originalPassword newPassword:(NSString *)newPassword completion:(void (^)(BOOL isSuccess,NSString *message))completion;


/**
 更新邮箱

 @param email 邮箱地址
 @param completion 完成回调
 */
- (void)updateEmail:(NSString *)email completion:(void (^)(BOOL isSuccess,NSString *message))completion;

/**
 验证邮箱

 @param email 邮箱
 @param completion 完成回调
 */
+ (void)verifyEmail:(NSString *)email completion:(void (^)(BOOL isSuccess,NSString *message))completion;

@end

NS_ASSUME_NONNULL_END
